using System.Collections;
using System.Collections.Generic;
using UnityEngine;

/// <summary>
/// 打折收费
/// </summary>
public class CashRebate : CashSuper
{
    /// <summary>
    /// 当前折扣
    /// </summary>
    private float moneyRebate = 1;


    public CashRebate(float moneyRebate)
    {
        this.moneyRebate = moneyRebate;
    }

    /// <summary>
    /// 设置当前折扣
    /// </summary>
    /// <param name="moneyRebate"></param>
    public void SetRebate(float moneyRebate)
    {
        this.moneyRebate = moneyRebate;
    }

    /// <summary>
    /// 当前打折后价格
    /// </summary>
    /// <param name="money"></param>
    /// <returns></returns>
    public override float AcceptCash(float money)
    {
        return money * moneyRebate;
    }
}
